package com.vhall.component.controller.account.adm;

import com.vhall.component.controller.account.facade.adm.AdminAuthFacade;
import com.vhall.component.entity.account.vo.AdminAuthLogOutReqVO;
import com.vhall.component.entity.account.vo.AdminAuthLoginReqVO;
import com.vhall.component.entity.account.vo.AdminAuthLoginRspVO;
import com.vhall.component.framework.common.annotation.VhallComponent;
import com.vhall.component.plugin.common.annotation.TokenAuth;
import com.vhall.component.service.account.AdminAuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;

/**
 * @author dalong
 * @date 2021-05-19 20:40
 */
@VhallComponent
public class AdminAuthController implements AdminAuthFacade {

    @Autowired
    private AdminAuthService adminAuthService;

    @Override
    public AdminAuthLoginRspVO login(@Validated AdminAuthLoginReqVO authLoginVO) {
        return adminAuthService.login(authLoginVO);
    }

    @Override
    @TokenAuth
    public boolean logout(@Validated AdminAuthLogOutReqVO logOutReqVO) {
        return adminAuthService.logOut(logOutReqVO);
    }
}
